/*
 * @Description: 流程管理接口
 * @Author: wangwangwang
 * @Date: 2020-08-05 15:08:52
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-03-01 11:14:36
 */
import request from '@/utils/request'

/**
 * @Description: 新增、修改流程List
 * @Param: 
 * @Author: wangwangwang
 */
export function saveOrUpdate(data) {
  return request({
    url: '/workflow/system/sign/process/manager/save_or_update',
    method: 'post',
    data,
  })
}
/**
 * @Description: 获取所有流程
 * @Param: 
 * @Author: wangwangwang
 */
export function getFlowsList(data) {
  return request({
    url: '/workflow/system/sign/process/manager/query_page',
    method: 'post',
    data,
  })
}
/**
 * @Description: 保存基础设置
 * @Param: 
 * @Author: wangwangwang
 */
export function setBaseData(data) {
  return request({
    url: '/workflow/system/sign/process/manager/settings/save_or_update',
    method: 'post',
    data,
  })
}
/**
 * @Description: 通过ID获取基础设置详情
 * @Param: 
 * @Author: wangwangwang
 */
export function getBaseDetail(data) {
  return request({
    url: '/workflow/system/sign/process/manager/settings/get_detail',
    method: 'get',
    params:data,
  })
}
/**
 * @Description: 保存表单设置
 * @Param: 
 * @Author: wangwangwang
 */
export function setFormData(data) {
  return request({
    url: '/workflow/system/sign/process/form/save_or_update',
    method: 'post',
    data,
  })
}
/**
 * @Description: 编辑表单
 * @Param: 
 * @Author: wangwangwang
 */
export function getFormData(data) {
  return request({
    url: '/workflow/system/sign/process/form/get_detail',
    method: 'get',
    params: data,
  })
}
/**
 * @Description: 保存流程设计
 * @Param: 
 * @Author: wangwangwang
 */
export function setFlowsData(data) {
  return request({
    url: '/workflow/system/sign/process/node/save_or_update_all_nodes',
    method: 'post',
    data,
  })
}

/**
 * @Description: 保存高级设置
 * @Param: 
 * @Author: wangwangwang
 */
export function setAdvanceData(data) {
  return request({
    url: '/workflow/system/sign/process/advanced/save_or_update',
    method: 'post',
    data,
  })
}
/**
 * @Description: 获取高级设置
 * @Param: 
 * @Author: wangwangwang
 */
export function getAdvanceData(data) {
  return request({
    url: '/workflow/system/sign/process/advanced/get_detail',
    method: 'get',
    params: data,
  })
}

/**
 * @Description: 获取开始节点和结束节点
 * @Param: 
 * @Author: wangwangwang
 */
export function getStartEnd(data) {
  return request({
    url: '/workflow/system/sign/process/node/get_first_and_last_node',
    method: 'get',
    params: data,
  })
}
/**
 * @Description: 获取当前流程的流程设计
 * @Param: 
 * @Author: wangwangwang
 */
export function getNodeData(data) {
  return request({
    url: '/workflow/system/sign/process/node/get_process_data',
    method: 'get',
    params: data,
  })
}
/**
 * @Description: 获取流程审批要素
 * @Param: 
 * @Author: wangwangwang
 */
export function getApprovElements(data) {
  return request({
    url: '/workflow/system/sign/process/approval/list',
    method: 'get',
    params: data,
  })
}
/**
 * @Description: 新增和修改流程审批要素
 * @Param: 
 * @Author: wangwangwang
 */
export function handleApproveElements(data) {
  return request({
    url: '/workflow/system/sign/process/approval/batch_save_or_update',
    method: 'post',
    data,
  })
}

/**
 * @Description: 流程任务维护
 * @Param: 
 * @Author: wangwangwang
 */
export function queryTaskPage(data) {
  return request({
    url: '/workflow/system/sign/task/center/query_task_page',
    method: 'post',
    data,
  })
}
/**
 * @Description: 强制删除流程
 * @Param: 
 * @Author: wangwangwang
 */
export function batchDelete(data) {
  return request({
    url: '/workflow/system/sign/task/center/batch_delete',
    method: 'post',
    data,
  })
}

/**
 * @Description: 获取可发起的流程
 * @Param: 
 * @Author: wangwangwang
 */
export function getFlowsList2(params) {
  return request({
    url: '/workflow/system/sign/process/manager/get_entry_list_v2',
    method: 'get',
    params,
  })
}
